import React from 'react'
import {Button} from 'antd'
import './module.less'
// import 'antd/dist/antd.css'

export default class child extends React.Component{
  constructor(props) {
    super(props)
    this.state = {
      count: 0
    }
  }

  componentWillMount() {
    console.log('will mount')
  }

  componentDidMount() {
    console.log('did mount')
  }

  componentWillReceiveProps(newProps) {
    console.log('will props' + newProps.name)
  }

  shouldComponentUpdate() {
    console.log('shoule update')
    return true
  }

  componentWillUpdate() {
    console.log('will update')
  }

  componentDidUpdate() {
    console.log('did update')
  }
  
  render() {
    return <div>
      <p className='text'>这是子组件测试子组件生命周期</p>
      <p>{this.props.name}</p>
      <Button>点击一下antd</Button>
    </div>
  }
}